<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/WEB-INF/views/wx/include/head.jsp" %>
<style>
.time{color:#dd524d;}
.time-info{color:#636262;text-align:center;font-size:18px;}
.pay-btn{margin-top:20px !important;}
.pay-money {font-size:24px;text-align:center;color:#007aff;}
.color-black {color:#000000;}
.time-center {padding-top:20px;padding-bottom:20px;}
.time-span {height:45px;line-height:45px;margin-left:55px;}
.checked {margin-top:10px;width:24px;height:24px;}
body,.mui-content {background-color:#ffffff !important;}
.line{width:100%;background-color:#efeff4;height:5px;}
</style>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a onclick="history.go(-1);" class="mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">支付方式</h1>
		<button onclick="window.location.href='${ctxWx }/pu/orders/orderList?orderstatus=${TORDERS_STATUS_NO_PAY }'" class="mui-btn mui-btn-blue mui-btn-link mui-pull-right">订单</button>
	</header>
	<div class="mui-content" >
		<div class="line"></div>
		<form id="dataForm" action="${ctxWx }/pu/pay/pay/" method="get">
			<input type="hidden" name="orderid" value="${orders.orderid }"/>
			<input type="hidden" name="ordertype" value="${orders.ordertype }"/>
			<input type="hidden" name="payway" value="${payWayType }"/>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<img class="mui-pull-left" src="${ctxStatic }/modules/wx/images/payway_wx.png" />
					<img class="mui-pull-right checked" src="${ctxStatic }/modules/wx/images/payway_checked.png" />
					<div class="mui-media-body time-span">微信支付</div>
				</li>
			</ul>
			<div class="mui-content-padded time-center">
				<h1 class="pay-money">￥${orders.dueamount }</h1>
				<h5 class="time-info">支付时间倒计时
					<c:if test="${not empty minutes }">
						<span class="time" id="leftTimeShow">--:--</span>
						<script type="text/javascript">
							// 锁定倒计时
							var minutes = ${minutes};
							var seconds = ${seconds};
							var se = window.setInterval("leftTimeShow()",1000);
							function leftTimeShow(){
								var secondsStr = '';
								if(seconds < 10) {
									secondsStr = '0';
								}
								secondsStr += seconds;
								$('#leftTimeShow').text(minutes+':'+secondsStr);
								seconds--;
								if(seconds <= 0) {
									minutes--;
									seconds = 59;
								}
								if(minutes <= 0) {
									clearInterval(se);
								}
							}
						</script>
					</c:if>
				</h5>
			</div>
			<div class="mui-content-padded pay-btn">
				<button type="button" class="mui-btn mui-btn-block mui-btn-primary" onclick="check();">立即支付</button>
			</div>
			<div class="mui-content-padded">
				<button type="button" onclick="window.location.href='${ctxWx}/pu/pay/cancel?orderid=${orders.orderid}'" class="mui-btn mui-btn-warning mui-btn-block">取消支付</button>
			</div>
			<c:if test="${orders.ordertype eq TORDERS_ORDER_TYPE_REALSCHE_SELF_TRAVEL}">
			<div class="mui-content-padded">
				<button type="button" onclick="window.location.href='${ctxWx}/pu/realsche/query?boardaddr=${boardaddrfc}&offaddr=${offaddrfc}&boardaddrName=${boardaddrNamefc }&offaddrName=${offaddrNamefc }&departdateStr=${departdateStr }'" class="mui-btn mui-btn-warning mui-btn-100">购票返程</button>
			</div>
			</c:if>
		</form>
	</div>
	<%@ include file="/WEB-INF/views/wx/include/script.jsp"%>
	<script>
		function check(){
			$('#dataForm').submit();
		}
	</script>
</body>
</html>